﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Jifen.master" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="SY.WebSite.Web.Jifen.Index" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>素币系统 - <%= Settings.Title %></title>
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/pagination.css" rel="stylesheet" type="text/css" />
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/skin/default/main.css" rel="stylesheet" type="text/css" />
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/template/trimpath-template.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/jquery.pagination.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/jquery.ui.uapselector.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" Runat="Server">
    <h5>素币明细查询</h5>
    <p>
        员工：<label type="text" class="date" id="userId" style="position: relative; top:11px;"></label>
        <label class="type right">时间段：</label>
        <input id="start" type="text" class="Wdate date" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'end\')}'})"/>&nbsp; - &nbsp;<input id="end" type="text" class="Wdate date" onClick="WdatePicker({minDate:'#F{$dp.$D(\'start\')}'})"/>
    </p>
    <p>
        消费类型：
        <label class="type"><input type="radio" name="type" value="0" checked="checked"/>&nbsp;全部</label>
        <label class="type"><input type="radio" name="type" value="1"/>&nbsp;收入</label>
        <label class="type"><input type="radio" name="type" value="2"/>&nbsp;支出</label>&nbsp;&nbsp;&nbsp;
        <input type="button" class="small button" value="查询" id="btnQuery" />
    </p>
    
    <div class="header" id="query-head">
        <div>
            <h6><span id="txtUserName"></span> [<span id="txtJobName"></span>]</h6>
            已消费素币：<label id="txtUsed" class="type"></label>
            冻结素币：<label id="txtFreeze" class="type"></label>
            特殊素币：<label id="txtHonor" class="type"></label>
            可用素币：<span id="txtAvailable" class="type"></span>&nbsp;&nbsp;
            <span id="txtTransfer" style="display:none"><input id="btnTransfer" type="button" class="small button" value="素币交易" /></span>
        </div>
    </div>

    <div id="result"></div>
    <div id="pagination"></div>

    <textarea name="transaction" id="transaction" style="display:none;">        
        <table class="niceTab" width="100%" cellspacing="0" cellpadding="0" border="0">
            <thead>
                <tr><th class="three">时间</th><th class="one">类型</th><th class="two">素币数</th><th>备注</th></tr>
            </thead>
            <tbody>
                {for l in list}
                    <tr><td class="center">@{l.DateTime.ToDate().Format("yyyy-MM-dd hh:mm")}</td><td class="center">{if l.Type ==1}收入{elseif}支出{/if}</td><td class="center">@{l.Amount}</td><td>@{page.showComment(l)}</td></tr>
                {forelse}
                    <tr><td colspan="4" style="text-align:center;">暂无素币交易明细</td></tr>
                {/for}
            </tbody>
        </table>
    </textarea>
    
    <textarea name="querymore" id="querymore" style="display:none;">        
        <div class="header">
            <h5>{if page.more =="available"}可用素币{else}已消费素币{/if}排行榜</h5>
        </div>
        <table class="niceTab" width="100%" cellspacing="0" cellpadding="0" border="0">
            <thead>
                <tr><th>排名</th><th>姓名</th><th>部门</th><th>{if page.more =="available"}可用素币{else}已消费素币{/if}</th></tr>
            </thead>
            <tbody>
                {for l in list}
                    <tr><td class="center">@{l.RowNumber}</td><td class="center">@{l.UserName}(@{l.JobNumber})</td><td class="center">@{l.DeptName}</td></Td><td class="center">{if page.more =="available"}@{l.Available}{else}@{l.Used}{/if}</td></tr>
                {forelse}
                    <tr><td colspan="4" style="text-align:center;">暂无相关信息</td></tr>
                {/for}
            </tbody>
        </table>
    </textarea>

    <script src="<%= Settings.StaticFileDomain %>/Scripts/page/jifen/index.js" type="text/javascript"></script>
    <script type="text/javascript">
        page.userList =<%= ToJson(UserList) %>;
        page.more = '<%= Request.QueryString["more"] %>';
        page.queryUserId = <%=  Request.QueryString["userId"] ?? CurrentUser.JobNumber.ToString() %>;
    </script>
</asp:Content>